/**
 * 2017年7月17日
 */
package spring;

import java.io.File;
import java.net.URISyntaxException;

import org.springframework.aop.framework.ProxyFactory;
import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.context.support.FileSystemXmlApplicationContext;

import spring.Holder;
/**
 * @author Alex
 *
 */
public class SpringMain {
	public static void main(String[] args) throws BeansException, URISyntaxException {
//		s = "D:\\template\\beans.xml";

		String s = (new File(SpringMain.class.getClassLoader().getResource("spring/beans.xml").toURI())).getAbsolutePath();
		BeanFactory bf = new FileSystemXmlApplicationContext(s);
		
		Hello h = (Hello) bf.getBean("helloImpl");
		h.say("Alex");
		
		h.ssfxxkss();
//		Fxxk fk = (Fxxk)bf.getBean(Fxxk.class);
//		fk.say("Mercer");
//		fk.abcfxxkff();
//		Holder h = (Holder)bf.getBean(Holder.class);
//		h.func();
		
//		ProxyFactory pf = new ProxyFactory();
//		pf.setProxyTargetClass(false);
//		pf.setTarget(new HelloImpl());
//		
//		pf.addAdvice(new BeforeAdvice());
//		pf.addAdvice(new AlexThrowsAdvice());
//		
//		Hello h = (Hello)pf.getProxy();
//		
//		System.out.println(h.toString());
	}
}
